package com.kefu.call.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kefu.call.mapper.ActivityUserInfoMapper;
import com.kefu.call.model.ActivityUserInfo;
import com.kefu.common.service.AbstractKefuService;

/**
 * @author francis
 * @date 2021/05/22
 */
@Service
@Transactional
public class ActivityUserInfoService  extends AbstractKefuService<ActivityUserInfo> {
    @Resource
    protected ActivityUserInfoMapper activityUserInfoMapper;

    
    public String saveUserList(List<ActivityUserInfo> list) {
        if (list.isEmpty()) {
            return "";
        }
        String activityId=list.stream().findAny().get().getActivityId();
        ActivityUserInfo delete=new ActivityUserInfo();
        delete.setActivityId(activityId);
        activityUserInfoMapper.delete(delete);
        save(list);
        return "";            
    }
}
